using System.IO;
using System.Linq;
using iTextSharp.text;

namespace Wikey.Domain.Components
{
    public class PdfExport
    {
        public void Generate(string exportPath,string content)
        {
            HtmlToPdfBuilder builder = new HtmlToPdfBuilder(PageSize.LETTER);

            HtmlPdfPage first = builder.AddPage();
            
            first.AppendHtml(content);
            
            


            byte[] file = builder.RenderPdf();
            File.WriteAllBytes(exportPath, file);

        }
    }
}